package com.lxd.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lxd.entity.enums.DateTimePatternEnum;
import com.lxd.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @Author Dongdong
 * @注释
 */

public class UserRequest {
    /**
     *
     */
    private Long userId;

    /**
     *
     */
    private String email;

    /**
     *
     */
    private String password;

    /**
     *
     */
    private Integer sex;

    /**
     *
     */
    private String userRealName;

    /**
     *
     */
    private String userName;

    /**
     *
     */
    private String role;

    private String clubId;


    /**
     *
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    /**
     *
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedAt;

    private boolean setAdmin;  // 是否设置为管理员

    public String getClubId() {
        return clubId;
    }

    public void setClubId(String clubId) {
        this.clubId = clubId;
    }

    public void setUserId(Long userId){
        this.userId = userId;
    }

    public Long getUserId(){
        return this.userId;
    }

    public void setEmail(String email){
        this.email = email;
    }

    public String getEmail(){
        return this.email;
    }

    public void setPassword(String password){
        this.password = password;
    }

    public String getPassword(){
        return this.password;
    }

    public void setSex(Integer sex){
        this.sex = sex;
    }

    public Integer getSex(){
        return this.sex;
    }

    public void setUserRealName(String userRealName){
        this.userRealName = userRealName;
    }

    public String getUserRealName(){
        return this.userRealName;
    }

    public void setUserName(String userName){
        this.userName = userName;
    }

    public String getUserName(){
        return this.userName;
    }

    public void setRole(String role){
        this.role = role;
    }

    public String getRole(){
        return this.role;
    }

    public void setCreatedAt(Date createdAt){
        this.createdAt = createdAt;
    }

    public Date getCreatedAt(){
        return this.createdAt;
    }

    public void setUpdatedAt(Date updatedAt){
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt(){
        return this.updatedAt;
    }

    public boolean isSetAdmin() {
        return setAdmin;
    }

    public void setSetAdmin(boolean setAdmin) {
        this.setAdmin = setAdmin;
    }

    @Override
    public String toString (){
        return "userId:"+(userId == null ? "空" : userId)+"，email:"+(email == null ? "空" : email)+"，password:"+(password == null ? "空" : password)+"，sex:"+(sex == null ? "空" : sex)+"，userRealName:"+(userRealName == null ? "空" : userRealName)+"，userName:"+(userName == null ? "空" : userName)+"，role:"+(role == null ? "空" : role)+"，createdAt:"+(createdAt == null ? "空" : DateUtil.format(createdAt, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()))+"，updatedAt:"+(updatedAt == null ? "空" : DateUtil.format(updatedAt, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()));
    }
}
